
package com.ebupt.migu.songlist.enums;
import lombok.Getter;


/**
 * 时间枚举
 * @author tz
 */
@Getter
public enum TimeEnum {

	/**
	 * 日
	 */
	DAY(1, "近24小时"),
	/**
	 * 周
	 */
	WEEK(2, "近7天"),
	/**
	 * 月
	 */
	MONTH(3, "近30天");

	private Integer code;
	private String name;

	TimeEnum(int code, String name){
		this.code = code;
		this.name = name;
	}

	public static String getNameByCode(int code){
		for (TimeEnum v: values()) {
			if(v.getCode()==code){
				return v.getName();
			}
		}
		return null;
	}
}
